var { src, dest, series } = require('gulp');
var del = require('del');
var gts = require('gulp-typescript');
// import { src, dest, series } from 'gulp'
// import { del } from 'del'
// import { gts } from 'gulp-typescript'

var gtsp = gts.createProject('tsconfig.json');
var paths = {
  buildRoot: 'build',
  ts: {
    src: 'src/**/*.ts',
    dest: 'build'
  }
}
function clear(cb) {
  del(paths.buildRoot);
  cb();
}
function build() {
  return src(paths.ts.src)
    .pipe(gtsp())
    .pipe(dest(paths.ts.dest));
}
exports.clear = clear;
exports.build = series(clear, build);
